.class public Lcom/TwinBlade/PicturePassword/SaveActivity;
.super Landroid/app/Activity;
.source "SourceFile"


# static fields
.field public static a:Landroid/widget/Button;

.field public static b:Z

.field private static c:Z

.field private static d:Landroid/app/Activity;


# instance fields
.field private e:Landroid/graphics/Bitmap;

.field private f:Landroid/os/Handler;

.field private g:Ljava/lang/Runnable;

.field private h:Landroid/content/Context;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 32
    const/4 v0, 0x1

    sput-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->c:Z

    .line 41
    const/4 v0, 0x0

    sput-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->b:Z

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 30
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    return-void
.end method

.method private a(Landroid/graphics/BitmapFactory$Options;II)I
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 161
    iget v1, p1, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    .line 162
    iget v2, p1, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    .line 163
    const/4 v0, 0x1

    .line 165
    if-gt v1, p3, :cond_0

    if-le v2, p2, :cond_1

    .line 166
    :cond_0
    if-le v1, v2, :cond_2

    .line 167
    int-to-float v0, v2

    int-to-float v1, p2

    div-float/2addr v0, v1

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    .line 172
    :cond_1
    :goto_0
    return v0

    .line 169
    :cond_2
    int-to-float v0, v1

    int-to-float v1, p3

    div-float/2addr v0, v1

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    goto :goto_0
.end method

.method static synthetic a(Lcom/TwinBlade/PicturePassword/SaveActivity;Lcom/TwinBlade/PicturePassword/cs;Lcom/TwinBlade/PicturePassword/bk;)Landroid/widget/FrameLayout;
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 175
    invoke-direct {p0, p1, p2}, Lcom/TwinBlade/PicturePassword/SaveActivity;->a(Lcom/TwinBlade/PicturePassword/cs;Lcom/TwinBlade/PicturePassword/bk;)Landroid/widget/FrameLayout;

    move-result-object v0

    return-object v0
.end method

.method private a(Lcom/TwinBlade/PicturePassword/cs;Lcom/TwinBlade/PicturePassword/bk;)Landroid/widget/FrameLayout;
    .locals 6
    .parameter
    .parameter

    .prologue
    .line 176
    new-instance v0, Landroid/widget/FrameLayout;

    invoke-direct {v0, p0}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 177
    if-eqz p1, :cond_1

    .line 178
    invoke-virtual {v0, p1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 183
    :cond_0
    :goto_0
    new-instance v1, Landroid/widget/Button;

    invoke-direct {v1, p0}, Landroid/widget/Button;-><init>(Landroid/content/Context;)V

    sput-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    .line 184
    sget-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    const v2, 0x7f09008d

    invoke-virtual {p0, v2}, Lcom/TwinBlade/PicturePassword/SaveActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 185
    sget-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    const/4 v3, -0x1

    .line 186
    const/4 v4, -0x2

    .line 187
    const/16 v5, 0x51

    invoke-direct {v2, v3, v4, v5}, Landroid/widget/FrameLayout$LayoutParams;-><init>(III)V

    .line 185
    invoke-virtual {v1, v2}, Landroid/widget/Button;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 188
    sget-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    const/16 v2, 0x8

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setVisibility(I)V

    .line 189
    sget-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    new-instance v2, Lcom/TwinBlade/PicturePassword/bj;

    invoke-direct {v2, p0}, Lcom/TwinBlade/PicturePassword/bj;-><init>(Lcom/TwinBlade/PicturePassword/SaveActivity;)V

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 195
    sget-object v1, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    .line 197
    return-object v0

    .line 179
    :cond_1
    if-eqz p2, :cond_0

    .line 180
    invoke-virtual {v0, p2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    goto :goto_0
.end method

.method public static a()V
    .locals 1

    .prologue
    .line 212
    sget-object v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->d:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->finish()V

    .line 213
    return-void
.end method

.method private a(Landroid/content/Intent;)V
    .locals 3
    .parameter

    .prologue
    .line 201
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 202
    if-eqz v0, :cond_0

    .line 203
    const-string v1, "Save"

    const-string v2, "Code"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 204
    const/4 v0, 0x1

    sput-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->c:Z

    .line 209
    :cond_0
    :goto_0
    return-void

    .line 205
    :cond_1
    const-string v1, "Test"

    const-string v2, "Code"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 206
    const/4 v0, 0x0

    sput-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->c:Z

    goto :goto_0
.end method

.method static synthetic a(Lcom/TwinBlade/PicturePassword/SaveActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 109
    invoke-direct {p0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->e()V

    return-void
.end method

.method private a(ZLjava/io/File;)V
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 129
    new-instance v0, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 130
    const/4 v1, 0x1

    iput-boolean v1, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 131
    if-eqz p1, :cond_0

    .line 133
    :try_start_0
    const-string v1, "PhotoData.jpg"

    invoke-virtual {p0, v1}, Lcom/TwinBlade/PicturePassword/SaveActivity;->openFileInput(Ljava/lang/String;)Ljava/io/FileInputStream;

    move-result-object v1

    .line 134
    const/4 v2, 0x0

    invoke-static {v1, v2, v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    .line 135
    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 143
    :goto_0
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->getWindowManager()Landroid/view/WindowManager;

    move-result-object v1

    invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    .line 144
    invoke-virtual {v1}, Landroid/view/Display;->getWidth()I

    move-result v2

    invoke-virtual {v1}, Landroid/view/Display;->getHeight()I

    move-result v1

    invoke-direct {p0, v0, v2, v1}, Lcom/TwinBlade/PicturePassword/SaveActivity;->a(Landroid/graphics/BitmapFactory$Options;II)I

    move-result v1

    iput v1, v0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 145
    const/4 v1, 0x0

    iput-boolean v1, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 147
    if-eqz p1, :cond_1

    .line 149
    :try_start_1
    const-string v1, "PhotoData.jpg"

    invoke-virtual {p0, v1}, Lcom/TwinBlade/PicturePassword/SaveActivity;->openFileInput(Ljava/lang/String;)Ljava/io/FileInputStream;

    move-result-object v1

    .line 150
    const/4 v2, 0x0

    invoke-static {v1, v2, v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    .line 151
    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 158
    :goto_1
    return-void

    .line 140
    :cond_0
    invoke-virtual {p2}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    goto :goto_0

    .line 156
    :cond_1
    invoke-virtual {p2}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    goto :goto_1

    .line 152
    :catch_0
    move-exception v0

    goto :goto_1

    .line 136
    :catch_1
    move-exception v1

    goto :goto_0
.end method

.method static synthetic b(Lcom/TwinBlade/PicturePassword/SaveActivity;)Landroid/graphics/Bitmap;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method public static b()V
    .locals 2

    .prologue
    .line 216
    sget-object v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    if-eqz v0, :cond_0

    .line 217
    sget-object v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->a:Landroid/widget/Button;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setVisibility(I)V

    .line 219
    :cond_0
    return-void
.end method

.method static synthetic c(Lcom/TwinBlade/PicturePassword/SaveActivity;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 39
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->h:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic c()Z
    .locals 1

    .prologue
    .line 32
    sget-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->c:Z

    return v0
.end method

.method static synthetic d()Landroid/app/Activity;
    .locals 1

    .prologue
    .line 34
    sget-object v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->d:Landroid/app/Activity;

    return-object v0
.end method

.method static synthetic d(Lcom/TwinBlade/PicturePassword/SaveActivity;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 36
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->f:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic e(Lcom/TwinBlade/PicturePassword/SaveActivity;)Ljava/lang/Runnable;
    .locals 1
    .parameter

    .prologue
    .line 37
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->g:Ljava/lang/Runnable;

    return-object v0
.end method

.method private e()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 110
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    const-string v1, "mounted"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 111
    invoke-virtual {p0, v3}, Lcom/TwinBlade/PicturePassword/SaveActivity;->getExternalFilesDir(Ljava/lang/String;)Ljava/io/File;

    move-result-object v0

    .line 112
    if-nez v0, :cond_0

    .line 113
    new-instance v0, Ljava/io/File;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "/PPAData"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 115
    :cond_0
    new-instance v1, Ljava/io/File;

    const-string v2, "PhotoData.jpg"

    invoke-direct {v1, v0, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 116
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 117
    const/4 v0, 0x0

    invoke-direct {p0, v0, v1}, Lcom/TwinBlade/PicturePassword/SaveActivity;->a(ZLjava/io/File;)V

    .line 119
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_1

    .line 126
    :goto_0
    return-void

    .line 125
    :cond_1
    const/4 v0, 0x1

    invoke-direct {p0, v0, v3}, Lcom/TwinBlade/PicturePassword/SaveActivity;->a(ZLjava/io/File;)V

    goto :goto_0
.end method


# virtual methods
.method public finish()V
    .locals 1

    .prologue
    .line 232
    sget-boolean v0, Lcom/TwinBlade/PicturePassword/SaveActivity;->b:Z

    if-eqz v0, :cond_0

    .line 233
    const/4 v0, -0x1

    invoke-virtual {p0, v0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->setResult(I)V

    .line 235
    :cond_0
    invoke-super {p0}, Landroid/app/Activity;->finish()V

    .line 236
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 5
    .parameter

    .prologue
    const/16 v1, 0x800

    const/4 v4, 0x0

    const/4 v3, 0x1

    .line 45
    invoke-virtual {p0, v3}, Lcom/TwinBlade/PicturePassword/SaveActivity;->requestWindowFeature(I)Z

    .line 46
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1, v1}, Landroid/view/Window;->setFlags(II)V

    .line 47
    iput-object p0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->h:Landroid/content/Context;

    .line 49
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 50
    const-string v1, "ForceOrientation"

    const-string v2, "0"

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 51
    const-string v1, "0"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 52
    invoke-static {}, Lcom/TwinBlade/PicturePassword/Utilities;->a()Z

    move-result v0

    if-nez v0, :cond_1

    .line 53
    invoke-virtual {p0, v3}, Lcom/TwinBlade/PicturePassword/SaveActivity;->setRequestedOrientation(I)V

    .line 63
    :cond_0
    :goto_0
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 65
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/TwinBlade/PicturePassword/SaveActivity;->a(Landroid/content/Intent;)V

    .line 67
    sput-object p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->d:Landroid/app/Activity;

    .line 68
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->f:Landroid/os/Handler;

    .line 69
    new-instance v0, Lcom/TwinBlade/PicturePassword/bh;

    invoke-direct {v0, p0}, Lcom/TwinBlade/PicturePassword/bh;-><init>(Lcom/TwinBlade/PicturePassword/SaveActivity;)V

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->g:Ljava/lang/Runnable;

    .line 100
    new-instance v0, Lcom/TwinBlade/PicturePassword/bi;

    invoke-direct {v0, p0}, Lcom/TwinBlade/PicturePassword/bi;-><init>(Lcom/TwinBlade/PicturePassword/SaveActivity;)V

    .line 106
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 107
    return-void

    .line 55
    :cond_1
    invoke-virtual {p0, v4}, Lcom/TwinBlade/PicturePassword/SaveActivity;->setRequestedOrientation(I)V

    goto :goto_0

    .line 57
    :cond_2
    const-string v1, "1"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 58
    invoke-virtual {p0, v3}, Lcom/TwinBlade/PicturePassword/SaveActivity;->setRequestedOrientation(I)V

    goto :goto_0

    .line 59
    :cond_3
    const-string v1, "2"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 60
    invoke-virtual {p0, v4}, Lcom/TwinBlade/PicturePassword/SaveActivity;->setRequestedOrientation(I)V

    goto :goto_0
.end method

.method public onDestroy()V
    .locals 1

    .prologue
    .line 223
    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    .line 224
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_0

    .line 225
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 226
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/SaveActivity;->e:Landroid/graphics/Bitmap;

    .line 228
    :cond_0
    return-void
.end method
